package com.zscat.mallplus.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zscat.mallplus.annotation.IgnoreAuth;
import com.zscat.mallplus.dms.service.IDmsBannerService;
import com.zscat.mallplus.dms.service.IQsgJoinService;
import com.zscat.mallplus.qsg.QsgJoin;
import com.zscat.mallplus.utils.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * 加盟管理Controller
 */
@RestController
@Api(tags = "QsgJoinController", description = "加盟管理")
@RequestMapping("/api/dms/join")
public class QsgJoinController {

    @Autowired
    private IQsgJoinService joinService;

    @IgnoreAuth
    @PostMapping(value = "/saveJoinInfo")
    @ApiOperation(value = "加盟列表")
    public Object saveJoinInfo(QsgJoin join) {
        try {
            join.setCreateDatetime(new Date());
            if (joinService.save(join)){
                return new CommonResult().success();
            }
            return new CommonResult().failed();
        }catch (Exception e){
            e.printStackTrace();
            return new CommonResult().failed();
        }
    }
}
